<!--#include file="base.asp"-->
<!--#include file="incFile.asp"-->
<%
	Dim objXMLHTTP, objXML
	Dim strURL, strFileToGo, strURLToGo, strXML
	Dim intPos1, IntPos2
	
	Set objXMLHTTP = Server.CreateObject("Msxml2.SERVERXMLHTTP.4.0")

	strURL = Request.QueryString
	intPos1 = InStr(strURL, "-")
	intPos2 = InStr(intPos1 + 1, strURL, "-")
	If (intPos1 = 0 And intPos2 = 0) Then
		strURL = "-vessel_list.asp-&" & strURL
		intPos1 = InStr(strURL, "-")
		intPos2 = InStr(intPos1 + 1, strURL, "-")
	End If
	strFileToGo = Mid(strURL, intPos1 + 1, intPos2 - 6)	'without - 2 symbols and .asp Total 6
	strURL = Replace(strURL, "-" & strFiletoGO & ".asp-", "")
	strURL = Mid(strURL, 2, Len(strURL))
	strURL = Replace(strURL, "&source_xml", "")
	strURLToGo = base & "/t_server/" & strFileToGo & ".asp?" & strURL
	strURLtoGo = Replace(strURLToGO,"&scid="&strCompaniesId&"","")
	strURLtoGo = Replace(strURLToGO,"&slid="&strLoginsId&"","")
	If (InStr(strURLToGo,"r_addr") = 0) Then
		strURLToGo = strURLToGo & "&r_addr=" & CStr(Request.SERVERVARIABLES("REMOTE_ADDR")) &  "&server=" & CStr(Request.SERVERVARIABLES("SERVER_NAME")) & Replace(CStr(Request.SERVERVARIABLES("URL")), "main.asp", "")
	End If
	strURLToGo = Replace(strURLToGo,"&no_menu=1","")
	strURLToGo = strURLToGo & "&unique=" & Server.URLEncode(CStr(Now)) & "&no_menu=1&scid="&strCompaniesId&"&slid="&strLoginsId&"&source_xml"
	strURLToGo = Replace(strURLToGo, "&&", "&")
	strURLToGo = Replace(strURLToGo, "?&", "?")
''Response.Write("<font color=""#000000"">" & strURLToGo & "</font><br>")
'Response.Write("<font color=""#ff0000"">Debug :<a href=""" & strURLToGo & """ >View XML</a><br></font>")
''Response.Write("<font color=""#ff0000"">Debug :<a href=""" & CStr(Replace(strURLToGo, "&source_xml", "")) & """ >View Server Version</a><br></font>")
	objXMLHTTP.Open "GET", strURLToGo, False
	Call objXMLHTTP.Send("")
	Set objXML = objXMLHTTP.ResponseXML
	Call XMLToHTMLOutput(objXML, "xsl/" & strFileToGO & ".xsl")
	Set objXML = Nothing
	Set objXMLHTTP = Nothing
%>
